<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Linux 运维人员最常用 150 个命令汇总, 小康,xkloveme,博客">
    <meta name="description" content="linux 命令是对 Linux 系统进行管理的命令。对于 Linux 系统来说，无论是中央处理器、内存、磁盘驱动器、键盘、鼠标，还是用户等都是文件， Linux 系统管理的命令是它正常运行的核心，与之前的 DOS 命令类似。linux 命">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>Linux 运维人员最常用 150 个命令汇总 | 小康之家</title>
    <link rel="icon" type="image/x-icon, image/vnd.microsoft.icon" href="/favicon.ico">

    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/font-awesome/5.12.1/css/all.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/materialize/1.0.0/css/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/aos/3.0.0-beta.6/aos.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/animate.css/3.5.1/animate.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdn.bootcss.com/lightgallery/1.6.11/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    
<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/atom.xml" title="小康之家" type="application/atom+xml">
<link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>


<body >
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper head-container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">小康之家</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">小康之家</div>
        <div class="logo-desc">
            
            小康のblog
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/xkloveme" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>

        </div>

        
            <style>
  .nav-transparent .github-corner {
    display: none !important;
  }

  .github-corner {
    position: absolute;
    z-index: 10;
    top: 0;
    right: 0;
    border: 0;
    transform: scale(1.1);
  }

  .github-corner svg {
    color: #027aff;
    fill: #fff;
    height: 64px;
    width: 64px;
  }

  .github-corner:hover .octo-arm {
    animation: a 0.56s ease-in-out;
  }

  .github-corner .octo-arm {
    animation: none;
  }

  @keyframes a {
    0%,
    to {
      transform: rotate(0);
    }
    20%,
    60% {
      transform: rotate(-25deg);
    }
    40%,
    80% {
      transform: rotate(10deg);
    }
  }
</style>

<a
  href="https://github.com/xkloveme"
  class="github-corner tooltipped hide-on-med-and-down"
  target="_blank"
  data-tooltip="Fork Me"
  data-position="left"
  data-delay="50"
>
  <svg viewBox="0 0 250 250" aria-hidden="true">
    <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
    <path
      d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
      fill="currentColor"
      style="transform-origin: 130px 106px;"
      class="octo-arm"
    ></path>
    <path
      d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
      fill="currentColor"
      class="octo-body"
    ></path>
  </svg>
</a>

        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('https://picsum.photos/600/300?t=0csowi2z7bl')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <div class="description center-align post-title">
                        Linux 运维人员最常用 150 个命令汇总
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="https://cdn.bootcss.com/tocbot/4.10.0/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/%E6%8A%80%E6%9C%AF/">
                                <span class="chip bg-color">技术</span>
                            </a>
                        
                            <a href="/tags/Linux/">
                                <span class="chip bg-color">Linux</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/%E6%95%99%E7%A8%8B/" class="post-category">
                                教程
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2017-11-22
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    2.4k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    8 分
                </div>
                
				
                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
            
        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <p>linux 命令是对 Linux 系统进行管理的命令。对于 Linux 系统来说，无论是中央处理器、内存、磁盘驱动器、键盘、鼠标，还是用户等都是文件， Linux 系统管理的命令是它正常运行的核心，与之前的 DOS 命令类似。linux 命令在系统中有两种类型：内置 Shell 命令和 Linux 命令。</p>
<p>命令</p>
<p>功能说明</p>
<p><strong>线上查询及帮助命令 (2 个)</strong></p>
<p>man</p>
<p>查看命令帮助，命令的词典，更复杂的还有 info，但不常用。</p>
<p>help</p>
<p>查看 Linux 内置命令的帮助，比如 cd 命令。</p>
<p><strong>文件和目录操作命令 (18 个)</strong></p>
<p>ls</p>
<p>全拼 list，功能是列出目录的内容及其内容属性信息。</p>
<p>cd</p>
<p>全拼 change directory，功能是从当前工作目录切换到指定的工作目录。</p>
<p>cp</p>
<p>全拼 copy，其功能为复制文件或目录。</p>
<p>find</p>
<p>查找的意思，用于查找目录及目录下的文件。</p>
<p>mkdir</p>
<p>全拼 make directories，其功能是创建目录。</p>
<p>mv</p>
<p>全拼 move，其功能是移动或重命名文件。</p>
<p>pwd</p>
<p>全拼 print working directory，其功能是显示当前工作目录的绝对路径。</p>
<p>rename</p>
<p>用于重命名文件。</p>
<p>rm</p>
<p>全拼 remove，其功能是删除一个或多个文件或目录。</p>
<p>rmdir</p>
<p>全拼 remove empty directories，功能是删除空目录。</p>
<p>touch</p>
<p>创建新的空文件，改变已有文件的时间戳属性。</p>
<p>tree</p>
<p>功能是以树形结构显示目录下的内容。</p>
<p>basename</p>
<p>显示文件名或目录名。</p>
<p>dirname</p>
<p>显示文件或目录路径。</p>
<p>chattr</p>
<p>改变文件的扩展属性。</p>
<p>lsattr</p>
<p>查看文件扩展属性。</p>
<p>file</p>
<p>显示文件的类型。</p>
<p>md5sum</p>
<p>计算和校验文件的 MD5 值。</p>
<p><strong>查看文件及内容处理命令（21 个）</strong></p>
<p>cat</p>
<p>全拼 concatenate，功能是用于连接多个文件并且打印到屏幕输出或重定向到指定文件中。</p>
<p>tac</p>
<p>tac 是 cat 的反向拼写，因此命令的功能为反向显示文件内容。</p>
<p>more</p>
<p>分页显示文件内容。</p>
<p>less</p>
<p>分页显示文件内容，more 命令的相反用法。</p>
<p>head</p>
<p>显示文件内容的头部。</p>
<p>tail</p>
<p>显示文件内容的尾部。</p>
<p>cut</p>
<p>将文件的每一行按指定分隔符分割并输出。</p>
<p>split</p>
<p>分割文件为不同的小片段。</p>
<p>paste</p>
<p>按行合并文件内容。</p>
<p>sort</p>
<p>对文件的文本内容排序。</p>
<p>uniq</p>
<p>去除重复行。oldboy</p>
<p>wc</p>
<p>统计文件的行数、单词数或字节数。</p>
<p>iconv</p>
<p>转换文件的编码格式。</p>
<p>dos2unix</p>
<p>将 DOS 格式文件转换成 UNIX 格式。</p>
<p>diff</p>
<p>全拼 difference，比较文件的差异，常用于文本文件。</p>
<p>vimdiff</p>
<p>命令行可视化文件比较工具，常用于文本文件。</p>
<p>rev</p>
<p>反向输出文件内容。</p>
<p>grep/egrep</p>
<p>过滤字符串，三剑客老三。</p>
<p>join</p>
<p>按两个文件的相同字段合并。</p>
<p>tr</p>
<p>替换或删除字符。</p>
<p>vi/vim</p>
<p>命令行文本编辑器。</p>
<p><strong>文件压缩及解压缩命令（4 个）</strong></p>
<p>tar</p>
<p>打包压缩。oldboy</p>
<p>unzip</p>
<p>解压文件。</p>
<p>gzip</p>
<p>gzip 压缩工具。</p>
<p>zip</p>
<p>压缩工具。</p>
<p><strong>信息显示命令（11 个）</strong></p>
<p>uname</p>
<p>显示操作系统相关信息的命令。</p>
<p>hostname</p>
<p>显示或者设置当前系统的主机名。</p>
<p>dmesg</p>
<p>显示开机信息，用于诊断系统故障。</p>
<p>uptime</p>
<p>显示系统运行时间及负载。</p>
<p>stat</p>
<p>显示文件或文件系统的状态。</p>
<p>du</p>
<p>计算磁盘空间使用情况。</p>
<p>df</p>
<p>报告文件系统磁盘空间的使用情况。</p>
<p>top</p>
<p>实时显示系统资源使用情况。</p>
<p>free</p>
<p>查看系统内存。</p>
<p>date</p>
<p>显示与设置系统时间。</p>
<p>cal</p>
<p>查看日历等时间信息。</p>
<p><strong>搜索文件命令（4 个）</strong></p>
<p>which</p>
<p>查找二进制命令，按环境变量 PATH 路径查找。</p>
<p>find</p>
<p>从磁盘遍历查找文件或目录。</p>
<p>whereis</p>
<p>查找二进制命令，按环境变量 PATH 路径查找。</p>
<p>locate</p>
<p>从数据库  (/var/lib/mlocate/mlocate.db)  查找命令，使用 updatedb 更新库。</p>
<p><strong>用户管理命令（10 个）</strong></p>
<p>useradd</p>
<p>添加用户。</p>
<p>usermod</p>
<p>修改系统已经存在的用户属性。</p>
<p>userdel</p>
<p>删除用户。</p>
<p>groupadd</p>
<p>添加用户组。</p>
<p>passwd</p>
<p>修改用户密码。</p>
<p>chage</p>
<p>修改用户密码有效期限。</p>
<p>id</p>
<p>查看用户的 uid,gid 及归属的用户组。</p>
<p>su</p>
<p>切换用户身份。</p>
<p>visudo</p>
<p>编辑 / etc/sudoers 文件的专属命令。</p>
<p>sudo</p>
<p>以另外一个用户身份（默认 root 用户）执行事先在 sudoers 文件允许的命令。</p>
<p><strong>基础网络操作命令（11 个）</strong></p>
<p>telnet</p>
<p>使用 TELNET 协议远程登录。</p>
<p>ssh</p>
<p>使用 SSH 加密协议远程登录。</p>
<p>scp</p>
<p>全拼 secure copy，用于不同主机之间复制文件。</p>
<p>wget</p>
<p>命令行下载文件。</p>
<p>ping</p>
<p>测试主机之间网络的连通性。</p>
<p>route</p>
<p>显示和设置 linux 系统的路由表。</p>
<p>ifconfig</p>
<p>查看、配置、启用或禁用网络接口的命令。</p>
<p>ifup</p>
<p>启动网卡。</p>
<p>ifdown</p>
<p>关闭网卡。</p>
<p>netstat</p>
<p>查看网络状态。</p>
<p>ss</p>
<p>查看网络状态。</p>
<p><strong>深入网络操作命令（9 个）</strong></p>
<p>nmap</p>
<p>网络扫描命令。</p>
<p>lsof</p>
<p>全名 list open files，也就是列举系统中已经被打开的文件。</p>
<p>mail</p>
<p>发送和接收邮件。</p>
<p>mutt</p>
<p>邮件管理命令。</p>
<p>nslookup</p>
<p>交互式查询互联网 DNS 服务器的命令。</p>
<p>dig</p>
<p>查找 DNS 解析过程。</p>
<p>host</p>
<p>查询 DNS 的命令。</p>
<p>traceroute</p>
<p>追踪数据传输路由状况。</p>
<p>tcpdump</p>
<p>命令行的抓包工具。</p>
<p><strong>有关磁盘与文件系统的命令（16 个）</strong></p>
<p>mount</p>
<p>挂载文件系统。</p>
<p>umount</p>
<p>卸载文件系统。</p>
<p>fsck</p>
<p>检查并修复 Linux 文件系统。</p>
<p>dd</p>
<p>转换或复制文件。</p>
<p>dumpe2fs</p>
<p>导出 ext2/ext3/ext4 文件系统信息。</p>
<p>dump</p>
<p>ext2/3/4 文件系统备份工具。</p>
<p>fdisk</p>
<p>磁盘分区命令，适用于 2TB 以下磁盘分区。</p>
<p>parted</p>
<p>磁盘分区命令，没有磁盘大小限制，常用于 2TB 以下磁盘分区。</p>
<p>mkfs</p>
<p>格式化创建 Linux 文件系统。</p>
<p>partprobe</p>
<p>更新内核的硬盘分区表信息。</p>
<p>e2fsck</p>
<p>检查 ext2/ext3/ext4 类型文件系统。</p>
<p>mkswap</p>
<p>创建 Linux 交换分区。</p>
<p>swapon</p>
<p>启用交换分区。</p>
<p>swapoff</p>
<p>关闭交换分区。</p>
<p>sync</p>
<p>将内存缓冲区内的数据写入磁盘。</p>
<p>resize2fs</p>
<p>调整 ext2/ext3/ext4 文件系统大小。</p>
<p><strong>系统权限及用户授权相关命令（4 个）</strong></p>
<p>chmod</p>
<p>改变文件或目录权限。</p>
<p>chown</p>
<p>改变文件或目录的属主和属组。</p>
<p>chgrp</p>
<p>更改文件用户组。</p>
<p>umask</p>
<p>显示或设置权限掩码。</p>
<p><strong>查看系统用户登陆信息的命令（7 个）</strong></p>
<p>whoami</p>
<p>显示当前有效的用户名称，相当于执行 id -un 命令。</p>
<p>who</p>
<p>显示目前登录系统的用户信息。</p>
<p>w</p>
<p>显示已经登陆系统的用户列表，并显示用户正在执行的指令。</p>
<p>last</p>
<p>显示登入系统的用户。</p>
<p>lastlog</p>
<p>显示系统中所有用户最近一次登录信息。</p>
<p>users</p>
<p>显示当前登录系统的所有用户的用户列表。</p>
<p>finger</p>
<p>查找并显示用户信息。</p>
<p><strong>内置命令及其它（19 个）</strong></p>
<p>echo</p>
<p>打印变量，或直接输出指定的字符串</p>
<p>printf</p>
<p>将结果格式化输出到标准输出。</p>
<p>rpm</p>
<p>管理 rpm 包的命令。</p>
<p>yum</p>
<p>自动化简单化地管理 rpm 包的命令。</p>
<p>watch</p>
<p>周期性的执行给定的命令，并将命令的输出以全屏方式显示。</p>
<p>alias</p>
<p>设置系统别名。</p>
<p>unalias</p>
<p>取消系统别名。</p>
<p>date</p>
<p>查看或设置系统时间。</p>
<p>clear</p>
<p>清除屏幕，简称清屏。</p>
<p>history</p>
<p>查看命令执行的历史纪录。</p>
<p>eject</p>
<p>弹出光驱。</p>
<p>time</p>
<p>计算命令执行时间。</p>
<p>nc</p>
<p>功能强大的网络工具。</p>
<p>xargs</p>
<p>将标准输入转换成命令行参数。</p>
<p>exec</p>
<p>调用并执行指令的命令。</p>
<p>export</p>
<p>设置或者显示环境变量。</p>
<p>unset</p>
<p>删除变量或函数。</p>
<p>type</p>
<p>用于判断另外一个命令是否是内置命令。</p>
<p>bc</p>
<p>命令行科学计算器</p>
<p><strong>系统管理与性能监视命令 (9 个)</strong></p>
<p>chkconfig</p>
<p>管理 Linux 系统开机启动项。</p>
<p>vmstat</p>
<p>虚拟内存统计。</p>
<p>mpstat</p>
<p>显示各个可用 CPU 的状态统计。</p>
<p>iostat</p>
<p>统计系统 IO。</p>
<p>sar</p>
<p>全面地获取系统的 CPU、运行队列、磁盘  I/O、分页（交换区）、内存、 CPU 中断和网络等性能数据。</p>
<p>ipcs</p>
<p>用于报告 Linux 中进程间通信设施的状态，显示的信息包括消息列表、共享内存和信号量的信息。</p>
<p>ipcrm</p>
<p>用来删除一个或更多的消息队列、信号量集或者共享内存标识。</p>
<p>strace</p>
<p>用于诊断、调试 Linux 用户空间跟踪器。我们用它来监控用户空间进程和内核的交互，比如系统调用、信号传递、进程状态变更等。</p>
<p>ltrace</p>
<p>命令会跟踪进程的库函数调用, 它会显现出哪个库函数被调用。</p>
<p><strong>关机 / 重启 / 注销和查看系统信息的命令（6 个）</strong></p>
<p>shutdown</p>
<p>关机。</p>
<p>halt</p>
<p>关机。</p>
<p>poweroff</p>
<p>关闭电源。</p>
<p>logout</p>
<p>退出当前登录的 Shell。</p>
<p>exit</p>
<p>退出当前登录的 Shell。</p>
<p>Ctrl+d</p>
<p>退出当前登录的 Shell 的快捷键。</p>
<p><strong>进程管理相关命令（15 个）</strong></p>
<p>bg</p>
<p>将一个在后台暂停的命令，变成继续执行   （在后台执行）。</p>
<p>fg</p>
<p>将后台中的命令调至前台继续运行。</p>
<p>jobs</p>
<p>查看当前有多少在后台运行的命令。</p>
<p>kill</p>
<p>终止进程。</p>
<p>killall</p>
<p>通过进程名终止进程。</p>
<p>pkill</p>
<p>通过进程名终止进程。</p>
<p>crontab</p>
<p>定时任务命令。</p>
<p>ps</p>
<p>显示进程的快照。</p>
<p>pstree</p>
<p>树形显示进程。</p>
<p>nice/renice</p>
<p>调整程序运行的优先级。</p>
<p>nohup</p>
<p>忽略挂起信号运行指定的命令。</p>
<p>pgrep</p>
<p>查找匹配条件的进程。</p>
<p>runlevel</p>
<p>查看系统当前运行级别。</p>
<p>init</p>
<p>切换运行级别。</p>
<p>service</p>
<p>启动、停止、重新启动和关闭系统服务，还可以显示所有系统服务的当前状态。</p>

            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://jixioakang.com" rel="external nofollow noreferrer">xkloveme</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://jixioakang.com/2017/11/22/2017-11-23-linux-yun-wei-ren-yuan-zui-chang-yong-150-ge-ming-ling-hui-zong/">http://jixioakang.com/2017/11/22/2017-11-23-linux-yun-wei-ren-yuan-zui-chang-yong-150-ge-ming-ling-hui-zong/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="http://jixioakang.com" target="_blank">xkloveme</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/%E6%8A%80%E6%9C%AF/">
                                    <span class="chip bg-color">技术</span>
                                </a>
                            
                                <a href="/tags/Linux/">
                                    <span class="chip bg-color">Linux</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
  #reward {
    margin: 40px 0;
    text-align: center;
  }

  #reward .reward-link {
    font-size: 1.4rem;
    line-height: 38px;
  }

  #reward .btn-floating:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
  }

  #rewardModal {
    width: 320px;
  }

  #rewardModal .reward-title {
    margin: 15px auto;
    padding-bottom: 5px;
  }

  #rewardModal .modal-content {
    padding: 10px;
  }

  #rewardModal .close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 1.3rem;
    line-height: 20px;
    cursor: pointer;
  }

  #rewardModal .close:hover {
    color: #ef5350;
    transform: scale(1.3);
    -moz-transform: scale(1.3);
    -webkit-transform: scale(1.3);
    -o-transform: scale(1.3);
  }

  #rewardModal .reward-tabs {
    margin: 0 auto;
    width: 210px;
  }

  .reward-tabs .tabs {
    height: 38px;
    margin: 10px auto;
    padding-left: 0;
  }

  .reward-content ul {
    padding-left: 0 !important;
  }

  .reward-tabs .tabs .tab {
    height: 38px;
    line-height: 38px;
  }

  .reward-tabs .tab a {
    color: #fff;
    background-color: #ccc;
  }

  .reward-tabs .tab a:hover {
    background-color: #ccc;
    color: #fff;
  }

  .reward-tabs .wechat-tab .active {
    color: #fff !important;
    background-color: #22ab38 !important;
  }

  .reward-tabs .alipay-tab .active {
    color: #fff !important;
    background-color: #019fe8 !important;
  }

  .reward-tabs .reward-img {
    width: 210px;
  }
</style>

<div id="reward">
  <a
    href="#rewardModal"
    class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red"
    >赏</a
  >

  <!-- Modal Structure -->
  <div id="rewardModal" class="modal">
    <div class="modal-content">
      <a class="close modal-close"><i class="fas fa-times"></i></a>
      <h4 class="reward-title">你的赏识是我前进的动力</h4>
      <div class="reward-content">
        <div class="reward-tabs">
          <ul class="tabs row">
            <li class="tab col s6 alipay-tab waves-effect waves-light">
              <a href="#alipay">支付宝</a>
            </li>
            <li class="tab col s6 wechat-tab waves-effect waves-light">
              <a href="#wechat">微 信</a>
            </li>
          </ul>
          <div id="alipay">
            <img
              src="/medias/reward/alipay.jpg"
              class="reward-img"
              alt="支付宝打赏二维码"
            />
          </div>
          <div id="wechat">
            <img
              src="/medias/reward/wechat.png"
              class="reward-img"
              alt="微信打赏二维码"
            />
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<script>
  $(function() {
    $(".tabs").tabs();
  });
</script>

            
        </div>
    </div>

    
        <link rel="stylesheet" href="https://cdn.bootcss.com/gitalk/1.6.2/gitalk.min.css">
<link rel="stylesheet" href="/css/my-gitalk.css">

<div class="card gitalk-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="gitalk-container" class="card-content"></div>
</div>

<script src="https://cdn.bootcss.com/gitalk/1.6.2/gitalk.min.js"></script>
<script>
    let gitalk = new Gitalk({
        clientID: 'f1e60c7afa53a51926b5',
        clientSecret: '2430231be04e68f6ba8ccf331c537cc19f50a0bd',
        repo: 'xkloveme.github.io',
        owner: 'xkloveme',
        admin: "xkloveme",
        id: '2017-11-22T18-16-00',
        distractionFreeMode: false  // Facebook-like distraction free mode
    });

    gitalk.render('gitalk-container');
</script>
    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2017/12/29/2017-12-29-nuxt-cai-guo-de-keng/">
                    <div class="card-image">
                        
                        
                        <img src="https://picsum.photos/600/300" class="responsive-img" alt="nuxt踩过的坑">
                        
                        <span class="card-title">nuxt踩过的坑</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            nuxt.js 简单介绍nuxt 官网：https://zh.nuxtjs.org/
1、nuxt.js 的原理图：具体的原理介绍官网有详细的解释，欢迎移步官网，这里不再复述。
2、nuxt.js 的优势1）就是我们无需为了路由划分而烦恼，
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2017-12-29
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E5%89%8D%E7%AB%AF/" class="post-category">
                                    前端
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E6%8A%80%E6%9C%AF/">
                        <span class="chip bg-color">技术</span>
                    </a>
                    
                    <a href="/tags/vue/">
                        <span class="chip bg-color">vue</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2017/11/21/2017-11-22-ye-mian-chong-zai-de-ji-chong-fang-fa/">
                    <div class="card-image">
                        
                        
                        <img src="https://picsum.photos/600/300" class="responsive-img" alt="页面重载的几种方法">
                        
                        <span class="card-title">页面重载的几种方法</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            location.reload(true);
history.go(0);
location.reload();
location = location;
location.assign(location);
document.execCo
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2017-11-21
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E5%89%8D%E7%AB%AF/" class="post-category">
                                    前端
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E6%8A%80%E6%9C%AF/">
                        <span class="chip bg-color">技术</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: 小康之家<br />'
            + '文章作者: xkloveme<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>

    
<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>

    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="https://cdn.bootcss.com/tocbot/4.10.0/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            // headingsOffset: -205,
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
  <div class="container row center-align">
    <div class="col s12 m8 l8 copy-right">
      Copyright&nbsp;&copy;
      <span id="year">年份</span>
      <a href="http://jixioakang.com" target="_blank">xkloveme</a>
      |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
      <br />
       &nbsp;<i
        class="fas fa-chart-area"
      ></i
      >&nbsp;站点总字数:&nbsp;<span class="white-color"
        >141.5k</span
      >&nbsp;字      
      <span id="busuanzi_container_site_pv">
        |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span
          id="busuanzi_value_site_pv"
          class="white-color"
        ></span
        >&nbsp;次
      </span>
       
      <span id="busuanzi_container_site_uv">
        |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span
          id="busuanzi_value_site_uv"
          class="white-color"
        ></span
        >&nbsp;人
      </span>
      
      <br />
      
      <span id="sitetime">载入运行时间...</span>
      <script>
        function siteTime() {
          window.setTimeout("siteTime()", 1000);
          var seconds = 1000;
          var minutes = seconds * 60;
          var hours = minutes * 60;
          var days = hours * 24;
          var years = days * 365;
          var today = new Date();
          var startYear = "2017";
          var startMonth = "3";
          var startDate = "13";
          var startHour = "0";
          var startMinute = "0";
          var startSecond = "0";
          var todayYear = today.getFullYear();
          var todayMonth = today.getMonth() + 1;
          var todayDate = today.getDate();
          var todayHour = today.getHours();
          var todayMinute = today.getMinutes();
          var todaySecond = today.getSeconds();
          var t1 = Date.UTC(
            startYear,
            startMonth,
            startDate,
            startHour,
            startMinute,
            startSecond
          );
          var t2 = Date.UTC(
            todayYear,
            todayMonth,
            todayDate,
            todayHour,
            todayMinute,
            todaySecond
          );
          var diff = t2 - t1;
          var diffYears = Math.floor(diff / years);
          var diffDays = Math.floor(diff / days - diffYears * 365);
          var diffHours = Math.floor(
            (diff - (diffYears * 365 + diffDays) * days) / hours
          );
          var diffMinutes = Math.floor(
            (diff - (diffYears * 365 + diffDays) * days - diffHours * hours) /
              minutes
          );
          var diffSeconds = Math.floor(
            (diff -
              (diffYears * 365 + diffDays) * days -
              diffHours * hours -
              diffMinutes * minutes) /
              seconds
          );
          if (startYear == todayYear) {
            document.getElementById("year").innerHTML = todayYear;
            document.getElementById("sitetime").innerHTML =
              "本站已安全运行 " +
              diffDays +
              " 天 " +
              diffHours +
              " 小时 " +
              diffMinutes +
              " 分钟 " +
              diffSeconds +
              " 秒";
          } else {
            document.getElementById("year").innerHTML =
              startYear + " - " + todayYear;
            document.getElementById("sitetime").innerHTML =
              "本站已安全运行 " +
              diffYears +
              " 年 " +
              diffDays +
              " 天 " +
              diffHours +
              " 小时 " +
              diffMinutes +
              " 分钟 " +
              diffSeconds +
              " 秒";
          }
        }
        setInterval(siteTime, 1000);
      </script>
      
      <br />
      
    </div>
    <div class="col s12 m4 l4 social-link social-statis">
      
    <a href="https://github.com/xkloveme" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:xkloveme@gmail.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>





    <a href="https://twitter.com/xkloveme" class="tooltipped" target="_blank" data-tooltip="关注我的Twitter: https://twitter.com/xkloveme" data-position="top" data-delay="50">
        <i class="fab fa-twitter"></i>
    </a>









    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>


    </div>
  </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="https://cdn.bootcss.com/materialize/1.0.0/js/materialize.min.js"></script>
    <script src="https://cdn.bootcss.com/masonry/4.0.0/masonry.pkgd.min.js"></script>
    <script src="https://cdn.bootcss.com/aos/3.0.0-beta.6/aos.js"></script>
    <script src="https://cdn.bootcss.com/scrollprogress/3.0.2/scrollProgress.min.js"></script>
    <script src="https://cdn.bootcss.com/lightgallery/1.6.11/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Global site tag (gtag.js) - Google Analytics -->

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-102352377-2"></script>
<script>
    window.dataLayer = window.dataLayer || [];
    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'UA-102352377-2');
</script>


    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    
    <script type="text/javascript" src="/libs/background/ribbon-dynamic.js" async="async"></script>
    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
